/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.etecmatao.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author admin
 */
@Entity
@Table(name = "albuns")
@NamedQueries({
    @NamedQuery(name = "Albuns.findAll", query = "SELECT a FROM Albuns a"),
    @NamedQuery(name = "Albuns.findByIdAlbuns", query = "SELECT a FROM Albuns a WHERE a.idAlbuns = :idAlbuns"),
    @NamedQuery(name = "Albuns.findByNome", query = "SELECT a FROM Albuns a WHERE a.nome = :nome"),
    @NamedQuery(name = "Albuns.findByData", query = "SELECT a FROM Albuns a WHERE a.data = :data"),
    @NamedQuery(name = "Albuns.findByDescricao", query = "SELECT a FROM Albuns a WHERE a.descricao = :descricao"),
    @NamedQuery(name = "Albuns.findByStatus", query = "SELECT a FROM Albuns a WHERE a.status = :status")})
public class Albuns implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_Albuns")
    private Integer idAlbuns;
    @Basic(optional = false)
    @Column(name = "nome")
    private String nome;
    @Basic(optional = false)
    @Column(name = "data")
    @Temporal(TemporalType.DATE)
    private Date data;
    @Basic(optional = false)
    @Column(name = "descricao")
    private String descricao;
    @Basic(optional = false)
    @Column(name = "status")
    private String status;
    @JoinColumn(name = "email", referencedColumnName = "email")
    @ManyToOne(optional = false)
    private Login login;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "albuns")
    private List<Fotos> fotosList;

    public Albuns() {
    }

    public Albuns(Integer idAlbuns) {
        this.idAlbuns = idAlbuns;
    }

    public Albuns(Integer idAlbuns, String nome, Date data, String descricao, String status) {
        this.idAlbuns = idAlbuns;
        this.nome = nome;
        this.data = data;
        this.descricao = descricao;
        this.status = status;
    }

    public Integer getIdAlbuns() {
        return idAlbuns;
    }

    public void setIdAlbuns(Integer idAlbuns) {
        this.idAlbuns = idAlbuns;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public Date getData() {
        return data;
    }

    public void setData(Date data) {
        this.data = data;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Login getLogin() {
        return login;
    }

    public void setLogin(Login login) {
        this.login = login;
    }

    public List<Fotos> getFotosList() {
        return fotosList;
    }

    public void setFotosList(List<Fotos> fotosList) {
        this.fotosList = fotosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idAlbuns != null ? idAlbuns.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Albuns)) {
            return false;
        }
        Albuns other = (Albuns) object;
        if ((this.idAlbuns == null && other.idAlbuns != null) || (this.idAlbuns != null && !this.idAlbuns.equals(other.idAlbuns))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return nome;
    }

}
